From eae6fc35e01dd8487710e1227d0a9689f517acae Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 16 Sep 2008 02:59:27 +0000 Subject: [PATCH] Termin gdx_map[] table, minor reformatting. Windows now works with "garmin mass storage as a garmin protocol" device. --- garmin_device_xml.c | 3 ++- jeeps/gpsusbwin.c | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/garmin_device_xml.c b/garmin_device_xml.c index 261422d19..981883b2a 100644 --- a/garmin_device_xml.c +++ b/garmin_device_xml.c @@ -102,6 +102,7 @@ static xg_tag_mapping gdx_map[] = { { ext_s, cb_cdata, "/Device/MassStorageMode/DataType/File/Location/FileExtension" }, { base_s, cb_cdata, "/Device/MassStorageMode/DataType/File/Location/BaseName" }, { dir_s, cb_cdata, "/Device/MassStorageMode/DataType/File/TransferDirection" }, + { 0, 0, NULL } }; const gdx_info * @@ -124,7 +125,7 @@ gdx_read(const char *fname) { const gdx_info * gdx_find_file(char **dirlist) { const gdx_info *gdx; - while (*dirlist) { + while (dirlist && *dirlist) { char *tbuf; xasprintf(&tbuf, "%s/%s", *dirlist, "/Garmin/GarminDevice.xml"); mountpoint = *dirlist; diff --git a/jeeps/gpsusbwin.c b/jeeps/gpsusbwin.c index b0b087c18..0b8c73847 100644 --- a/jeeps/gpsusbwin.c +++ b/jeeps/gpsusbwin.c @@ -185,16 +185,15 @@ HANDLE * garmin_usb_start(HDEVINFO* hdevinfo, SP_DEVICE_INTERFACE_DATA *infodata } -static char ** get_garmin_mountpoints() { +static char ** get_garmin_mountpoints(void) +{ #define BUFSIZE 512 TCHAR szTemp[MAX_PATH]; char *p = szTemp; char **dlist = xmalloc(0); int i = 0; - fprintf(stderr, "eek!\n"); - if (GetLogicalDriveStrings(BUFSIZE-1, szTemp)) - { + if (GetLogicalDriveStrings(BUFSIZE-1, szTemp)) { while(*p) { dlist = xrealloc(dlist, sizeof (*dlist ) * ++i); // fprintf(stderr, "Found: %d, %s\n", i, p); -- 2.30.2